import request from '@/utils/request'

// 查询【请填写功能名称】列表
export function listMain(query) {
  return request({
    url: '/oa/attendance/list',
    method: 'get',
    params: query
  })
}

// 查询【请填写功能名称】详细
export function getMain(id) {
  return request({
    url: '/oa/attendance/' + id,
    method: 'get'
  })
}

// 新增【请填写功能名称】
export function addMain(data) {
  return request({
    url: '/oa/attendance',
    method: 'post',
    data: data
  })
}

// 修改【请填写功能名称】
export function updateMain(data) {
  return request({
    url: '/oa/attendance/update',
    method: 'put',
    data: data
  })
}

// 删除【请填写功能名称】
export function delMain(id) {
  return request({
    url: '/oa/attendance/' + id,
    method: 'delete'
  })
}

//上传图片
export function upload_img(formData) {
  return request({
    url: '/oa/attendance/upload/img',
    method: 'post',
    data: formData,
    headers: {'Content-Type': 'multipart/form-data'},//'Content-Type': 'multipart/form-data'
  })
}

// 获取考勤类型
export function get_business_type() {
  return request({
    url: '/oa/attendance/businessList',
    method: 'get'
  })
}

// 获取对应流程节点信息
export function getActiviti(activitiId) {
  return request({
    url: '/oa/attendance/activitiList/' + activitiId,
    method: 'get'
  })
}

// 获取流程节点对应审批人员信息
export function getUserInfoByNodeId(nodeId) {
  return request({
    url: '/oa/attendance/userInfoList/' + nodeId,
    method: 'get'
  })
}

